Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed camera definition files for Yuneec camera #479

Merged
merged 9 commits into from
Aug 7, 2018

Conversation

julianoes
Copy link
Collaborator

This is an interim workaround where the camera definition xml files are embedded in the library.

The tool to embed the xml files is cpp_rsc.

@julianoes
Copy link
Collaborator Author

Note that this does not work for the iOS build yet because cpp_rsc compiles a binary that runs on the host as part of the build process. We need to work our way around this somehow, e.g. by re-using the cpp_rsc binary from the default build.

@julianoes julianoes force-pushed the embed-camera-defs branch 2 times, most recently from 2d5b54e to b68bd95 Compare August 2, 2018 14:56
This is a way to cache the camera defintion files inside the library.
It turned out rather tedious to do the embedding ourselves. Therefore,
we resort to using a helper repo for this.

I found this here:
https://stackoverflow.com/questions/4864866#answer-19180226
The Windows build failed with:
CUSTOMBUILD : error : Resource file
"/C:/dronecode_sdk/plugins/camera/camera_definition_files/e90.xml"
cannot be open.

I gave up at that point.
In order to build for e.g. iOS we need to re-use the cpp_rsc binary
which is built for the build host by the `default` build.
@hamishwillee
Copy link
Collaborator

So Yuneec MAVLink camera doesn't supply the camera definition file URL - as per the MAVLink Camera API spec?

@julianoes
Copy link
Collaborator Author

So Yuneec MAVLink camera doesn't supply the camera definition file URL - as per the MAVLink Camera API spec?

No, they do supply it but the problem is that the file is not accessible currently through the MFi transport layer (mavlink is transmitted but no http yet), so this is an interim workaround.

add_subdirectory(third_party/cpp_rsc/src)
else()
# For cross-compilation, re-use the binary from default.
set_property(GLOBAL PROPERTY CPPRSC_CMD ${CMAKE_CURRENT_BINARY_DIR}/../default/third_party/cpp_rsc/src/cpp_rsc)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get where that is used :/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. And add_resource and link_resource_file come from cpp_rsc as well.

Copy link
Collaborator

@JonasVautherin JonasVautherin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it a bit scary, but if we need it 😁...

add_subdirectory(third_party/cpp_rsc/src)
else()
# For cross-compilation, re-use the binary from default.
set_property(GLOBAL PROPERTY CPPRSC_CMD ${CMAKE_CURRENT_BINARY_DIR}/../default/third_party/cpp_rsc/src/cpp_rsc)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. And add_resource and link_resource_file come from cpp_rsc as well.

@JonasVautherin JonasVautherin merged commit 2d29ccd into develop Aug 7, 2018
@JonasVautherin JonasVautherin deleted the embed-camera-defs branch August 7, 2018 13:23
rt-2pm2 pushed a commit to rt-2pm2/DronecodeSDK that referenced this pull request Nov 27, 2018
Embed camera definition files for Yuneec camera
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants